package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "dic_area", schema = "", catalog = "onedollar")
public class DicAreaEntity {
    private int id;
    private int aid;
    private Integer pid;
    private String aname;
    private Integer level;
    private String amsg;
    private String aflag;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "aid", nullable = false, insertable = true, updatable = true)
    public int getAid() {
        return aid;
    }

    public void setAid(int aid) {
        this.aid = aid;
    }

    @Basic
    @Column(name = "pid", nullable = true, insertable = true, updatable = true)
    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    @Basic
    @Column(name = "aname", nullable = false, insertable = true, updatable = true, length = 100)
    public String getAname() {
        return aname;
    }

    public void setAname(String aname) {
        this.aname = aname;
    }

    @Basic
    @Column(name = "level", nullable = true, insertable = true, updatable = true)
    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    @Basic
    @Column(name = "amsg", nullable = true, insertable = true, updatable = true, length = 100)
    public String getAmsg() {
        return amsg;
    }

    public void setAmsg(String amsg) {
        this.amsg = amsg;
    }

    @Basic
    @Column(name = "aflag", nullable = true, insertable = true, updatable = true, length = 2)
    public String getAflag() {
        return aflag;
    }

    public void setAflag(String aflag) {
        this.aflag = aflag;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DicAreaEntity that = (DicAreaEntity) o;

        if (id != that.id) return false;
        if (aid != that.aid) return false;
        if (pid != null ? !pid.equals(that.pid) : that.pid != null) return false;
        if (aname != null ? !aname.equals(that.aname) : that.aname != null) return false;
        if (level != null ? !level.equals(that.level) : that.level != null) return false;
        if (amsg != null ? !amsg.equals(that.amsg) : that.amsg != null) return false;
        if (aflag != null ? !aflag.equals(that.aflag) : that.aflag != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + aid;
        result = 31 * result + (pid != null ? pid.hashCode() : 0);
        result = 31 * result + (aname != null ? aname.hashCode() : 0);
        result = 31 * result + (level != null ? level.hashCode() : 0);
        result = 31 * result + (amsg != null ? amsg.hashCode() : 0);
        result = 31 * result + (aflag != null ? aflag.hashCode() : 0);
        return result;
    }
}
